package day.day7_10;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext())
        {
            String str = scanner.nextLine();
            StringBuilder sb=new StringBuilder();
            int count = 0;
            int flag = 0;
            for (int i = 0; i < str.length(); i++)
            {
                if (str.charAt(i) == '\"')
                    flag++;
                else if (str.charAt(i) != ' ')
                    sb.append(str.charAt(i));
                else if (flag % 2 == 0)
                {
                    sb.append('\n');
                    count++;
                }
                else
                    sb.append(' ');
            }
            System.out.println(count + 1);
            System.out.println(sb.toString());
        }
    }
}
